package registnet.records.source;

import registnet.records.Employee;

public class EmployeeSource {

	private String employeeNumber;
	private Employee employee;
	
	
	/**
	 * Default constructor
	 * 
	 * @param employeeNumber - The employee number of the employee
	 */
	public EmployeeSource(String employeeNumber){
		this.employeeNumber = employeeNumber;
		this.load();
	}
	
	
	/**
	 * Loads data from source
	 */
	public void load(){
		registnet.dao.Employee DAOEmployee = new registnet.dao.EmployeePeer().getEmployee(employeeNumber);
		this.employee = new Employee(this.employeeNumber);
		this.employee.setFirstName(DAOEmployee.getFirstName());
		this.employee.setMiddleName(DAOEmployee.getMiddleName());
		this.employee.setLastName(DAOEmployee.getLastName());
	}
	
	
	/**
	 * Gets the employee
	 * 
	 * @return	The employee
	 */
	public Employee getEmployee(){
		return this.employee;
	}
}
